﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework;

namespace Brain
{
    public interface IRenderManager3D : IEngineManager, IEndDrawable, IDrawable, IUpdateable
    {
        GraphicsDevice GraphicsDevice { get; set; }

        void StartDraw(GameScreen gs);

        void FinishDraw(GameScreen gs);

        void SubmitWorldObject(IWorldObject worldObject);
        void RemoveWorldObject(IWorldObject worldObject);

        void Submit(object obj);
        void Remove(object obj);

        /// <summary>
        /// Updates the World Object status. Mostly used by Custom Renderers,
        /// where is needed to copy the World Matrix from the IWorldObject
        /// to another class of the Rendering Engine
        /// </summary>
        /// <param name="worldObject"></param>
        void UpdateWorldObjectStatus(IWorldObject worldObject);

        void SubmitLight(object light);
        void RemoveLight(object light);

        // Terrain Stuff

        Vector3 GetTerrainVertex(WorldObject terrain, int index);
        void InitializeTerrainDefaultRendering(TerrainWorldObject terrain, bool wipeCPUContent, bool makeTriangles);
        void UpdateTerrainVertexBuffer(WorldObject terrain, VertexBuffer buffer);
        void Editor_UpdateTerrainVertex(WorldObject terrain, int index, Vector3 newPos, Vector2 newTexCoord);

        /// <summary>
        /// Editor Used
        /// </summary>
        /// <param name="index"></param>
        /// <returns></returns>
        IWorldObject Editor_GetWorldObject(int index);
        int Editor_Count();
    }
}
